#!/bin/bash
# 项目根目录地址
root=xxx
# 生成基础服务代码
# window 加.exe 如：protoc-gen-go.exe
echo "com.lh.basic.service项目proto文件代码生产"
rm -rf $root/com.lh.basic.service/pb
protoc --proto_path=$root/com.lh.basic.service --plugin=protoc-gen-go=$GOPATH/bin/protoc-gen-go --go_out=$root \
--plugin=protoc-gen-go-grpc=$GOPATH/bin/protoc-gen-go-grpc --go-grpc_out=$root  \
--plugin=protoc-gen-validate=$GOPATH/bin/protoc-gen-validate --validate_out=$root --validate_opt=lang=go \
--plugin=protoc-gen-grpc-gateway=$GOPATH/bin/protoc-gen-grpc-gateway --grpc-gateway_out=$root $root/com.lh.basic.service/proto/*/*.proto

# 如需connect-go服务,请配置如下命令
#--plugin=protoc-gen-connect-go=$GOPATH/bin/protoc-gen-connect-go --connect-go_out=../  \